package com.danskin.wechat.service.impl;

import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.danskin.wechat.dao.WxFansMsgDao;
import com.danskin.wechat.entity.WxFansMsg;
import com.danskin.wechat.service.WxFansMsgService;
import com.danskin.wechat.util.LogUtil;

@Service
public class WxFansMsgServiceImpl implements WxFansMsgService{
	
	@Autowired
	private WxFansMsgDao wxFansMsgDao;
	
	public Long selectWxFansMsgPageCount(WxFansMsg wxFansMsg) {
		LogUtil.info("=======查询符合条件的微信粉丝信息数参数："+ToStringBuilder.reflectionToString(wxFansMsg));
		
		Long selectCount = 0L;
		
		try {
			selectCount = wxFansMsgDao.selectWxFansMsgPageCount(wxFansMsg);
		} catch (Exception e) {
			LogUtil.error("=======查询符合条件的微信粉丝信息数异常", e);
		}
		return selectCount;
	}
	
	public Long selectWxFansMsgCount(Integer mpId, Integer replyStatus, Date paramStartTime, Date paramEndTime) {
		Long selectCount = 0L;
		
		try {
			selectCount = wxFansMsgDao.selectWxFansMsgCount(mpId, replyStatus, paramStartTime, paramEndTime);
		} catch (Exception e) {
			LogUtil.error("=======查询符合条件的微信粉丝信息数异常", e);
		}
		return selectCount;
	}

}
